package com.example.demo.mapper;

import com.example.demo.entity.Record;
import com.example.demo.entity.RecordExample;
import com.example.demo.entity.SysUserExample;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface RecordMapper {
    int countByExample(RecordExample example);

    int deleteByExample(RecordExample example);

    int deleteByPrimaryKey(Integer sid);

    int insert(Record record);

    int insertSelective(Record record);

    List<Record> selectByExample(RecordExample example);

    Record selectByPrimaryKey(Integer sid);

    int updateByExampleSelective(@Param("record") Record record, @Param("example") RecordExample example);

    int updateByExample(@Param("record") Record record, @Param("example") RecordExample example);

    int updateByPrimaryKeySelective(Record record);

    int updateByPrimaryKey(Record record);

    @Insert("INSERT into s_record(name,age,sex,stoptime,starttime) VALUES (#{name},#{age},#{sex},#{stoptime},NOW())")
    public void add(Record record);

    @Update("UPDATE s_record SET sum=#{sum},stoptime=now() WHERE stoptime='至今'")
        public void update(Record record);

    List<Record> selectByExample(SysUserExample sysUserExample);
}